package org.jeecg.glr.util;

import com.fasterxml.jackson.databind.ObjectMapper;
import org.jeecg.glr.domain.led.DataDomain;
import java.io.IOException;

public class JSONUtil {

    public static DataDomain getDataDomain(String json) {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            DataDomain object = objectMapper.readValue(json,DataDomain.class);
            return object;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;

    }
    public static ResponseMessage getResponseMessage(String json) {
        try {
            ObjectMapper objectMapper = new ObjectMapper();
            ResponseMessage object = objectMapper.readValue(json,ResponseMessage.class);
            return object;
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;

    }

}
